const app = getApp()
Component({
	properties: {
		navbarData: { //navbarData   由父页面传递的数据，变量名字自命名
			type: Object,
			value: {},
			observer: function(newVal, oldVal) {}
		}
	},
	data: {
		height: '',
		//默认值  默认显示左上角
		navbarData: {
			showCapsule: 1
		},
		"pages": [
			"pages/dragTest/dragTest",
			"component/image-cropper-test/image-cropper-test",
			"component/uploadCropper/uploadCropper",
			"component/upload/upload",
			"pages/canvWasTest/canvasTest",
			"pages/authSetting/authSetting",
			"pages/hoursPicker/hoursPicker",
			"pages/roomCode/roomCode",
			"pages/textAlign/textAlign",
			"pages/reduceTwo/reduceTwo",
			"pages/head/head",
			"pages/objectCopy/objectCopy",
			"pages/noShake/noShake",
			"pages/es6/es6",
			"component/sc-test/sc-test",
			"component/showLoading/showLoading",
			"pages/formSubmit/formSubmit",
			"pages/cornerAdapter/cornerAdapter",
			"pages/image-test/image-test",

			"pages/e/e",
			"pages/index/index",
			"pages/a/a",
			"pages/arrowRotation/arrowRotation",
			"pages/test/test",


			"component/sc-modal/sc-modal",
			"component/group-list/group-list",
			"pages/date-time/date-time",
			"pages/ellipsis/ellipsis",
			"pages/l/l",
			"pages/j/j",
			"pages/k/k",
			"pages/search/search",
			"pages/i/i",
			"pages/pubu/pubu",
			"pages/g/g",
			"pages/h/h",
			"pages/b/b",
			"pages/logs/logs"

		],

		"pagesObj": {
			"pages/dragTest/dragTest": "拖拽组件-移动组件",
			"pages/canvasTest/canvasTest": "canvas生成图片、二维码、自定义文字样式",
			"pages/authSetting/authSetting": "获取相机权限、获取多个权限",
			"pages/hoursPicker/hoursPicker": "时间段选择-picker组件动态选择时间",
			"page/tabBar/roomCode/roomCode": "微信小程序实现图片文字二维码组合拼接成一张图片，下载到手机相册",
			"pages/textAlign/textAlign": "将text-align: justify 用在表单中，将文本两端对齐。",
			"pages/reduceTwo/reduceTwo": "对一维数组进行分类,并转换成二维数组展示",
			"pages/head/head": "用户头像",
			"pages/objectCopy/objectCopy": "对象深拷贝",
			"pages/noShake/noShake": "函数防抖_函数节流",
			"component/showLoading/showLoading": "加载中组件",
			"pages/formSubmit/formSubmit": "表单提交-多图片提交",
			"pages/image-test/image-test": "view+image出现上下间隔",
			"pages/cornerAdapter/cornerAdapter": "圆角宽度适配",
			"pages/arrowRotation/arrowRotation": "箭头旋转",
			"pages/es6/es6": "es6测试",
			"pages/a/a": "携带数据跳转到B",
			"pages/ellipsis/ellipsis": "一行省略",
			"pages/l/l": "相邻元素设置margin负值，引起覆盖层级问题解决方法",
			"pages/k/k": "打勾图标-代码实现",
			"component/sc-test/sc-test": "自定义组件-测试效果",
			"component/sc-modal/sc-modal": "自定义组件-对话框",
			"component/group-list/group-list": "自定义组件-动态栅格列表",
			"component/upload/upload": "自定义组件-裁剪图片",
			"component/uploadCropper/uploadCropper": "1选择图片-2裁剪图片",
			"component/image-cropper-test/image-cropper-test": "裁剪图片-支持拖动大小",
		}
	},
	attached: function() {
		// 获取是否是通过分享进入的小程序
		this.setData({
			share: app.globalData.share
		})
		// 定义导航栏的高度   方便对齐
		this.setData({
			height: app.globalData.height
		})
	},
	onLoad: function(options) {
		console.log('onLoad=')
	},
	onShow() {
		console.log('onShow')
		// console.log(getApp().pages)
	},
	methods: {
		// 返回上一页面
		_navback() {
			wx.navigateBack()
		},
		onSelectGroup(e) {
			let self = this,
				index = e.currentTarget.dataset.index;
        console.log('onSelectGroup')
			let pathurl = this.data.pages[index]
			wx.navigateTo({
				url: '/' + pathurl
			})
		}
	}

})